<template>
    <view class="wrap">
		
		<u-navbar :safeAreaInsetTop="false" title="无人机企业" :fixed="false" left-text="首页" right-text="添加路线" @rightClick="rightClick" @leftClick="leftClick" rightIcon="plus"> </u-navbar>
		

<view  style="display: flex;padding-top: 20rpx;"> 
    <u-button text="回首页" size="normal" type="success"  @click="leftClick" ></u-button>			 
    <u-button text="添加路线" size="normal" type="warning"  @click="rightClick" ></u-button>	 
</view>
		
         <u-notice-bar :text="text1"></u-notice-bar>
     <!--   <u-row justify="space-around">
            <u-col span="6">
                <view class="demo-layout "><u--image :showLoading="true" :src="src" width="120px" height="120px"></u--image></view>
            </u-col>

            <u-col span="6">
				
				<u-parse :content="content"></u-parse> 
            </u-col>-->
        </u-row>

        <u-line color="#2979ff"></u-line>
        

        <u-cell-group>
            
            <u-cell icon="list-dot" title="飞行路线报备" :value="indexinfo.luxiang" :titleStyle="{'color': '#e45656'}" isLink url="/pages/index/wurenji/wrjfeixing"></u-cell>
            <u-cell icon="setting-fill" title="企业信息"  :titleStyle="{'color': '#3c9cff'}" :value="indexinfo.qiye" isLink url="/pages/index/wurenji/wrjqiye"></u-cell>
            <u-cell icon="man-add-fill" title="无人机驾驶人" :titleStyle="{'color': '#398ade'}" :value="indexinfo.jsr" isLink url="/pages/index/wurenji/wrjjsrs"></u-cell>
            <u-cell icon="integral-fill" title="个人持有" :value="indexinfo.gerenchiyou" isLink url="/pages/index/wurenji/wrjgeren"></u-cell>
            
        </u-cell-group>
        
        
        
      <u-tabbar :value="value1" @change="change1" :fixed="true" :placeholder="false" :safeAreaInsetBottom="false" >
        	<u-tabbar-item text="首页" icon="home" name="home"></u-tabbar-item>
        	<u-tabbar-item text="网约车" icon="car" name="photo" ></u-tabbar-item>
        	<u-tabbar-item text="网约房" icon="file-text" name="wyf"></u-tabbar-item>
        	<u-tabbar-item text="3D打印" icon="bookmark" name="3dprint"></u-tabbar-item>
        	<u-tabbar-item text="我的" name="account" icon="account" ></u-tabbar-item>
        </u-tabbar>
        


    </view>
</template>

<script>
export default {
    data() {
        return {
			content: ` <p> 张店分局:大张派出所,辖区内共有无人机52台, 从业人员60人,<br />今日飞机路线共3条`,
             text1: '附近有无人机在飞机,请监管!',
             value1: 0,
			 indexinfo:{
				 luxiang :210,
				 qiye:60,
				 jsr:20,
				 gerenchiyou:0
			 },
            src: 'https://cdn.uviewui.com/uview/album/1.jpg'
        };
    },
	onLoad(e) {
		//this.qiyeid=e.id;			 
		//this.loadmore()
		this.uavindex();
	},
	
    methods: {
		
		uavindex: async function() {
			 
			let res = await this.$api.uavindex().then(res => {
				
				this.content=res.index.content;
				this.indexinfo=res.indexinfo;
				
				console.log(res);
				 
			});
			
		},
		

		
		rightClick() { 
			uni.$u.route({url: '/pages/index/wurenji/addluxian' })
		},
		
		leftClick() {
			uni.$u.route({type: 'tab',url: 'pages/index/index'})
		//console.log('leftClick');
		},
        
		onPageScroll(e) {
				this.scrollTop = e.scrollTop;
			},
        change1(e) {
        	console.log('change1', e);
            
            if(e=='home')  uni.$u.route({ url: 'pages/index/index',  type:'switchTab',	params: { name: 'lisa' } })
            if(e=='photo')  uni.$u.route({ url: 'pages/index/userinfo', 	params: { name: 'lisa' } })
            if(e=='wyf')  uni.$u.route({ url: 'pages/index/wyfangowner', 	params: { name: 'lisa' } })
            if(e=='3dprint')  uni.$u.route({ url: 'pages/index/3d/3d', 	params: { name: 'lisa' } })
            if(e=='account')  uni.$u.route({ url: 'pages/user/user',  type:'switchTab',	params: { name: 'lisa' } })
            
            
        },
  
        
    }
};
</script>

<style>
.wrap {
    padding: 4rpx;
}
.demo-layout {
    padding: 20rpx;
}
.qiye{
    color: #0066CC;
     
}

 .u-demo-block__content {display: flex;flex-direction: row;flex-wrap: wrap;align-items: center;}
</style>
